l = [1,2,2,2,3]
# 使用集合去重
print(list(set(l)))

# 循环思路
ret = []
for i in l:
    if i not in ret:
        ret.append(i)
print(ret)

# 使用{}创建集合
collection = {1,2,3,4}
print(type(collection)) # 输出: <class 'set'>

# 使用 set() 创建集合进行去重
l = [1,2,2,2,3]
t = (1,2,2,3,3)
c1 = set(l)
c2 = set(t)

print(c1, type(c1)) # 输出: {1, 2, 3} <class 'set'>
print(c2, type(c2)) # 输出: {1, 2, 3} <class 'set'>